package fantasyday.wowzolo.dao.impl;

import fantasyday.wowzolo.dao.AccountDao;
import fantasyday.wowzolo.domain.Account;

import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;

public class AccountDaoImpl extends SqlMapClientDaoSupport implements AccountDao {

	public Account getAccount(String username) {
		return (Account) getSqlMapClientTemplate().queryForObject("Account.getAccountByUsername", username);
	}

	public Account getAccountByUsernameAndPassword(Account account) {		
		return (Account) getSqlMapClientTemplate().queryForObject("Account.getAccountByUsernameAndPassword", account);
	}

	public void insertAccount(Account account) {		
		getSqlMapClientTemplate().insert("Account.insertAccount", account);
	}

	public int updateAccount(Account account) {
		return getSqlMapClientTemplate().update("Account.updateAccount", account);
	}
    public void insertProfile(Account account) {
        getSqlMapClientTemplate().insert("Account.insertProfile", account);
    }

    public int updateProfile(Account account) {
		return getSqlMapClientTemplate().update("Account.updateProfile", account);
	}

    public void insertSignon(Account account) {
        getSqlMapClientTemplate().insert("Account.insertSignon", account);
    }

    public int updateSignon(Account account) {
        return getSqlMapClientTemplate().update("Account.updateSignon", account);

    }
}